#ifndef AX_TIMER_H
#define AX_TIMER_H
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif

/* Timer mode */
typedef enum
{
    en_TIMER_LOOP,
    en_TIMER_NOLOOP,
    en_TIMER_MODE_MAX
} AX_TIMER_MODE;

typedef void (*ax_timer_cb_t)(int tid, int param1, int param2);

bool ax_timer_mgr_init(bool loop);
void ax_timer_mgr_free();
bool ax_timer_main();

int  ax_timer_create(ax_timer_cb_t cb);
bool ax_timer_destory(int tid);
bool ax_timer_start(int tid, long duradion_ms, AX_TIMER_MODE mode, int param1, int param2);
bool ax_timer_stop(int tid);
bool ax_timer_reset(int tid);
bool ax_timer_is_run(int tid);

#ifdef __cplusplus
}
#endif

#endif  // AX_TIMER_H
